<!DOCTYPE html>
<html>
	<head>
		<include file="Public/head" />
		<link rel="stylesheet" href="__PUBLIC__/Manage/css/table.css">
		<title>支付订单列表</title>
	</head>
	<body>
		<div class="nestable">
			<div class="console-title console-title-border drds-detail-title clearfix">
				<h5>支付订单</h5>
			</div>
			<form method="get" id="seachForm">
				<input type="hidden" name="m" value="Pay" />
				<input type="hidden" name="a" value="index" />
				<div class="public-selectArea">
					<div class="clearfix">
						<div class="wp_box col-xs-6">
							<dl>
								<dt>订单号：</dt>
								<dd>
									<input type="text" name="s-oid" value="{$Think.get.s-oid}">
								</dd>
							</dl>
						</div>
						<div class="wp_box col-xs-6">
		                	<dl>
		                    	<dt>状态：</dt>
		                        <dd>
		                          	<select class="select" name="status">
		                                <option value="" selected="selected">全部</option>
		                                <option value="0">未支付</option>
		                                <option value="1">已支付</option>
		                            </select>
		                        </dd>
		                    </dl>
						</div>
					</div>
					<div class="btnArea">
						<a href='javascript:$("#seachForm").submit();' class="btn btn-sereachBg">
							<i class="glyphicon glyphicon-search public-ico"></i>
							<span class="public-label">查询</span>
						</a>
					</div>
				</div>
			</form>
			<div class="scroll-bar-table">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>订单流水号</th>
							<th>用户名</th>
							<th>支付金额</th>
							<th>创建时间</th>
							<th>状态</th>
							<th>支付时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
<volist name="list" id="vo">
						<tr id="list-{$vo.id}">
							<td>{$vo.id}</td>
							<td>{$vo.user.telnum}</td>
							<td>{$vo.money}元</td>
							<td>{$vo.add_time|date="Y/m/d H:i:s",###}</td>
							<td>
								<if condition="$vo['status'] eq 1">已支付<else/>未支付</if>
							</td>
							<td>
								<if condition="$vo['status'] eq 1">{$vo.pay_time|date="Y/m/d H:i:s",###}<else/> - </if>
							</td>
							<td class="text-left">
								<a href="javascript:delPayOrder('{$vo.id}');">删除订单</a>
							</td>
						</tr>
</volist>
					</tbody>
				</table>
			</div>
			<div class="table-pagin-container">
				<div class="pull-right page-box">
					{$page}
				</div>
			</div>
		</div>
	</body>
	<script>
		function delPayOrder(id){
			layer.confirm(
				'建议保留订单,订单删除后不可恢复,请确认？',
				{
					btn: ['确认删除','取消']
				},function(){
					cvphp.post(
						"{:U('Pay/delOrder')}",
						{
							id:id
						},
						function(data){
							if(data.status!=1){
								layer.msg(data.info);
							}else{
								$("#list-"+id).remove();
								layer.msg("操作成功");
							}
						}
					);
				}
			);
		}
	</script>
</html>